Skip to content

feat: Add custom catch container node#145

Merged
ricardozanini merged 2 commits into
serverlessworkflow:mainfrom
lornakelly:141/catch-container
May 15, 2026
Merged

feat: Add custom catch container node#145
ricardozanini merged 2 commits into
serverlessworkflow:mainfrom
lornakelly:141/catch-container

Conversation

@lornakelly
Copy link
Copy Markdown
Contributor

@lornakelly lornakelly commented May 13, 2026

Closes #141

Summary

Resolve catch leaf vs catch container nodes at ReactFlow boundary as this is a rendering concern

Changes

  • Get a set of catch nodes that have children, identifying them as containers
  • Resolve catch nodes by mapping them to a custom type
  • Add catch container node to nodes
  • Extract shared createFlatGraph function as test helper

Copilot AI review requested due to automatic review settings May 13, 2026 15:59
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a ReactFlow-specific “catch container” node type so that Catch nodes with nested content can render differently from leaf Catch nodes, and refactors test helpers to reuse a shared createFlatGraph utility.

Changes:

  • Added detection of Catch nodes that have child nodes and map them to a custom ReactFlow node type (catch-container).
  • Registered a new ReactFlow node type/component for catch containers.
  • Extracted a shared createFlatGraph helper into tests/test-utils and reused it across tests.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
packages/serverless-workflow-diagram-editor/src/react-flow/diagram/diagramBuilder.ts Detect catch container nodes and resolve their ReactFlow node type during diagram build.
packages/serverless-workflow-diagram-editor/src/react-flow/nodes/Nodes.tsx Register catch-container ReactFlow node type and add a placeholder component for it.
packages/serverless-workflow-diagram-editor/tests/react-flow/diagram/diagramBuilder.test.ts Add unit tests for getCatchContainerNodeIds (with some test-name typos to fix).
packages/serverless-workflow-diagram-editor/tests/test-utils/graph-helpers.ts Introduce shared createFlatGraph test helper.
packages/serverless-workflow-diagram-editor/tests/test-utils/index.ts Re-export createFlatGraph from the test-utils barrel.
Comments suppressed due to low confidence (1)

packages/serverless-workflow-diagram-editor/tests/react-flow/diagram/diagramBuilder.test.ts:465

  • There are spelling mistakes in this test name (e.g., "inclyde", "insode"). Please correct them to keep test output readable and searchable.
    it("should inclyde nested catch containers insode a parent container", () => {

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/serverless-workflow-diagram-editor/src/react-flow/nodes/Nodes.tsx Outdated
Signed-off-by: lornakelly <lornakelly88@gmail.com>
Copy link
Copy Markdown
Member

@fantonangeli fantonangeli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, I tried to improve getCatchContainerNodeIds() but please check if it does what expected as I only tried with pnpm test

Copilot AI review requested due to automatic review settings May 14, 2026 13:57
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Signed-off-by: lornakelly <lornakelly88@gmail.com>
@lornakelly lornakelly force-pushed the 141/catch-container branch from b400ae8 to 9d50bcd Compare May 14, 2026 14:27
Copy link
Copy Markdown
Contributor

@handreyrc handreyrc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@lornakelly
Copy link
Copy Markdown
Contributor Author

@ricardozanini if you can merge when you get a chance please

@lornakelly lornakelly requested a review from ricardozanini May 15, 2026 07:54
@ricardozanini ricardozanini merged commit d9564e0 into serverlessworkflow:main May 15, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: Add CatchContainer to graph node types

5 participants